package com.itheima.d5_resource;

/*
     目标：认识try-catch-finally。
 */
public class Test1 {
    public static void main(String[] args) {
        method();
    }

    public static int method() {
        try {
            System.out.println("开始执行");
            int[] arr = {1,2,3,4,5};
            System.out.println(arr[100]);
            System.out.println("我可能不会执行");
            return 1;
        } catch (Exception e) {
            System.out.println("异常开始执行了");
        } finally {
            System.out.println("资源释放执行");
        }
        return 0;
    }

}
